-- @Author: 作者QQ381990860
-- @Date:   2021-11-05 10:34:34
-- @Last Modified by:   作者QQ381990860
-- @Last Modified time: 2022-07-23 06:58:55

local 场景类_飞行符 = class(窗口逻辑)
local tp,zts,zts1
local insert = table.insert

function 场景类_飞行符:初始化(根)
	self.ID = 25
	self.x = 130+(全局游戏宽度-800)/2
	self.y = 130
	self.xx = 0
	self.yy = 0
	self.注释 = "飞行符"
	self.可视 = false
	self.鼠标 = false
	self.焦点 = false
	self.可移动 = true
	local 资源 = 根.资源
	local 按钮 = 根._按钮
	local 自适应= 根._自适应
	self.资源组 = {
		[0] = 自适应.创建(0,1,498,300,3,9),
		[1] = 资源:载入('UI.dll',"网易WDF动画",0x00000017),
		[2] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0xDB61AD29),0,0,1,true,true),
		[3] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0x3D561594),0,0,1,true,true),
		[4] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0x6BD8F1C8),0,0,1,true,true),
		[5] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0xC5C5FE46),0,0,1,true,true),
		[6] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0x29622DDB),0,0,1,true,true),
		[7] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0x491E6B4C),0,0,1,true,true),
		[8] = 按钮.创建(资源:载入('JM.dll',"网易WDF动画",0x549B2B83),0,0,1,true,true),
	}
	for i=2,8 do
		self.资源组[i]:绑定窗口_(25)
	end
	tp = 根
	self.窗口时间 = 0
	self.坐标 = {[1]={x=70,y=140},[2]={x=195,y=140},[3]={x=320,y=140},[4]={x=70,y=290},[5]={x=195,y=290},[6]={x=320,y=290}}
	zts = tp.字体表.普通字体
    zts1 = tp.字体表.描边字体
end

function 场景类_飞行符:打开(类型,格子)
	if self.可视 then
		self.可视 = false
	else
	if  self.x > 全局游戏宽度 then
		self.x = 90+(全局游戏宽度-800)/2
    end
		 self.类型=类型
        self.格子=格子
		insert(tp.窗口_,self)
	    tp.运行时间 = tp.运行时间 + 1
	  	self.窗口时间 = tp.运行时间
	    self.可视 = true
	end
end

function 场景类_飞行符:显示(dt,x,y)
	for i=2,8 do
	   self.资源组[i]:更新(x,y)
	end
	self.焦点 = false
	if self.鼠标 then
		for i=1,7 do
			if self.资源组[i+1]:事件判断() then
				客户端:发送数据(self.格子,i,16)
				self:打开()
        	end
		end
	end
	self.资源组[0]:显示(self.x,self.y)
    tp.窗口标题背景_:显示(self.x+self.资源组[0].宽度/2-73,self.y)
    zts1:显示(self.x+self.资源组[0].宽度/2-24,self.y+1,"飞行符")

	self.资源组[1]:显示(self.x+2,self.y+22)
	self.资源组[2]:显示(self.x + 251,self.y + 89,true)  --宽-120  高-6
	self.资源组[3]:显示(self.x + 298,self.y + 197,true)
	self.资源组[4]:显示(self.x + 447,self.y + 251,true)
	self.资源组[5]:显示(self.x + 81,self.y + 24,true)
	self.资源组[6]:显示(self.x + 76,self.y + 92,true)
	self.资源组[7]:显示(self.x + 59,self.y + 168,true)
	self.资源组[8]:显示(self.x + 122,self.y + 231,true)
end

return 场景类_飞行符